<?php

namespace App\Listeners\Subscriber;

use Illuminate\Contracts\Events\Dispatcher;

class AbstractSubscriber
{

    protected $listen = [];


    /**
     *注册监听器.
     *
     * @param Dispatcher $dispatcher
     */
    public function subscribe(Dispatcher $dispatcher)
    {
        foreach ($this->listen as $event => $listen) {

            $dispatcher->listen($event, [$this, $listen]);
        }
    }
}